/****************************************************************************
Copyright (c) 2005 - 2015 Qualcomm Technologies International, Ltd.

*/

#include "aghfp.h"
#include "aghfp_private.h"
#include "aghfp_common.h"
#include "aghfp_send_data.h"

#include <string.h>
#include <sink.h>

/*******************************************************************************/
bool AghfpSendUserSpecificDataAllow(AGHFP *aghfp, uint16 size_data)
{
    if ( SinkIsValid(aghfp->rfcomm_sink) )
    {
        if (aghfp->mapped_rfcomm_sink == NULL)
        {
            if (SinkSlack(aghfp->rfcomm_sink) >= size_data)
            {
                return TRUE;
            }
        }
    }

    return FALSE;
}

/*******************************************************************************/
void AghfpSendUserSpecificData(AGHFP *aghfp, uint16 size_data, uint8 *data)
{
    if (size_data)
    {
        aghfpSendRawData(aghfp, size_data, data);
    }
    else
    {
        aghfpSendCommonCfmMessageToApp(AGHFP_USER_DATA_CFM, aghfp, aghfp_fail);
    }
}

